<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="smvc" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>显示学生信息</title>
<script src="${smvc}/js/jquery-3.1.1.js"></script>
<style>
	table{
		border-collapse:collapse;
	}
	td{
		border : 1px solid #000099;
		padding : 5px;
		color : #000099;
		
	}
	h2{
		color : #0000FF;
	}
	button{
		background-color : #00aaFF;
		border : 0px;
		color : #FFFFFF;
		height : 25px;
	}
</style>
</head>
<body>
	<h2 align="center">学生管理系统</h2>
	<p align="center"><button id="addButton">添加</button></p>
	
	 <table align="center" cellspacing="0">
	 	<tr>
	 		<td>姓名</td>
	 		<td>密码</td>
	 		<td>真实姓名</td>
	 		<td>班级</td>
	 		<td>电话</td>
	 		<td>邮件</td>
	 		<td>qq</td>
	 		<td>地址</td>
	 		<td>日期</td>
	 		<td>操作</td>
	 	</tr>
	 <c:forEach items="${stuList}" var="stu">
	 	<tr>
	 		<td>${stu.sname}</td>
	 		<td>${stu.passWord}</td>
	 		<td>${stu.trueName}</td>
	 		<td>${stu.className}</td>
	 		<td>${stu.phone}</td>
	 		<td>${stu.email}</td>
	 		<td>${stu.QQ}</td>
	 		<td>${stu.address}</td>
	 		<td>${stu.birthday}</td>
	 		<td>
		 		<a href="${smvc}/student/edit?id=${stu.id}">修改</a>
		 		<a href="${smvc}/student/delete?id=${stu.id}">删除</a>	
	 		</td>
	 	</tr>
	 	
	 </c:forEach>
	</table>
<script>
	$(function(){
		$("#addButton").bind("click",goAdd)
	});
	
	function goAdd(){
		window.location.href="${smvc}/student/edit"
	}
</script>
</body>
</html>